<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" name="rules[rule]" value="{$rule}">
    <input type="hidden" name="rules[mark]" value="{$mark}">
    {if condition="$insertRule neq ''"}
    <div class="panel panel-default">
        <div class="panel-heading">规则条件</div>
        <div class="panel-body">
            {$insertRule}
        </div>
    </div>
    {/if}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商家名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">关键字:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-keyword"  class="form-control" name="row[keyword]" type="text" value="{$row.keyword|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>


    <div class="form-group">
        <label for="c-src" class="control-label col-xs-12 col-sm-2">{:__('Src')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-src" class="form-control" size="35" name="row[src]" type="text" value="{$row.src}">
                <div class="input-group-addon no-border no-padding">
                    {if condition="$mark eq 'start'"}
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-src" data-mimetype="*" data-multiple="false" data-preview-id="p-src"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-src" data-mimetype="*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    {else /}
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-src" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-src"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-src" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    {/if}
                </div>
                <span class="msg-box n-right"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-src"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Linkurl')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-linkurl" data-rule="required" class="form-control" name="row[linkurl]" type="text" value="{$row.linkurl|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Target')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-target" data-rule="required" class="form-control selectpicker" name="row[target]">
                {foreach name="targetList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.target"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告展示方式:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-show_type" data-rule="required" class="form-control selectpicker" name="row[show_type]">
                {foreach name="ShowTypeList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.show_type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc_text')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc_text" data-rule="required" class="form-control " rows="5" name="row[desc_text]" cols="50">{$row.desc_text|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否有效:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::switcher('row[switch]', $row['switch'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
